- var fullLayout = !!(view.simulatorsLeaderboardData.topSimulators && view.simulatorsLeaderboardData.topSimulators)
.container
  .row
    if fullLayout
      .col-xs-2
        button(data-i18n="ladder.simulate_games").btn.btn-illustrated.btn-warning.btn-sm.btn-block.highlight#simulate-button
    div(class=fullLayout ? "col-xs-7" : "col-xs-7")
      #simulation-status-text
        if view.simulationStatus
          | #{view.simulationStatus}
        else
          if fullLayout
            span(data-i18n="ladder.simulation_explanation")
            span.spl(data-i18n="ladder.simulation_explanation_leagues")
  
    div(class=fulllLayout ? "col-xs-2" : "col-xs-4")
      .simulation-count
        span.spr(data-i18n="ladder.games_simulated_by")
        span#simulated-by-you= view.simulatedByYouCount.toLocaleString()
      //.simulation-count
      //  span.spr(data-i18n="ladder.games_simulated_for")
      //  span#simulated-for-you= me.get('simulatedFor') || 0
      if view.simulatorsLeaderboardData && view.simulatorsLeaderboardData.numberOfGamesInQueue > 0
        .simulation-count
          span.spr(data-i18n="ladder.games_in_queue")
          span#games-in-queue= view.simulatorsLeaderboardData.numberOfGamesInQueue ? view.simulatorsLeaderboardData.numberOfGamesInQueue.toLocaleString() : 0

if view.simulatorsLeaderboardData && view.simulatorsLeaderboardData.topSimulators
  - var topSimulators = view.simulatorsLeaderboardData.topSimulators.models;
  - var showJustTop = view.simulatorsLeaderboardData.inTopSimulators() || me.get('anonymous');
  - if(!showJustTop) topSimulators = topSimulators.slice(0, 10);
  table.table.table-bordered.table-condensed.table-hover
    thead
      tr
        th
        th(data-i18n="general.player").name-col-cell
        th(data-i18n="ladder.games_simulated")
        //th(data-i18n="ladder.games_played")
        //th(data-i18n="ladder.ratio")
    tbody
      for user, rank in topSimulators
        - var myRow = user.id == me.id
        tr(class=myRow ? "success" : "")
          td.simulator-leaderboard-cell= rank + 1
          td.name-col-cell= user.get('name') || "Anonymous"
          td.simulator-leaderboard-cell= (user.get('simulatedBy') || 0).toLocaleString()
          //td.simulator-leaderboard-cell= user.get('simulatedFor')
          //td.simulator-leaderboard-cell= Math.round((user.get('simulatedBy') / user.get('simulatedFor')) * 10) / 10

      - var nearbySimulators = view.simulatorsLeaderboardData.nearbySimulators()
      if !showJustTop && nearbySimulators
        tr(class="active")
          td(colspan=5).ellipsis-row ...
        for user in nearbySimulators
          - var myRow = user.id == me.id
          //- var ratio = user.get('simulatedBy') / user.get('simulatedFor');
          tr(class=myRow ? "success" : "")
            td.simulator-leaderboard-cell= user.rank
            td.name-col-cell= user.get('name') || "Anonymous"
            td.simulator-leaderboard-cell= (user.get('simulatedBy') || 0).toLocaleString()
            //td.simulator-leaderboard-cell= user.get('simulatedFor')
            //td.simulator-leaderboard-cell= _.isNaN(ratio) || ratio == Infinity ? '' : ratio.toFixed(1)
